package com.wang.users.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wang.common.pojo.BasePojo;

/**
 * 体侧标准表
 * 
 * @author MyJjh
 *
 */
public class ABodyStand extends BasePojo<ABodyStand>
{
	private int id;
	private int grade;
	private byte sex;
	private int vitalcapacity;
	private double longrun;
	private double shortrun;
	private double height;
	private double weight;
	private double bml;
	private int abdominalcurl;
	private double sittingforward;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;

	private String sexStr;
	private String statusStr;

	/*
	 * 方便枚举项在网页上显示出来 键为值(数字), 值为字符串描述 只提供get方法
	 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		ABodyStandEnum[] standEnums = ABodyStandEnum.values();
		for (int i = 0; i < standEnums.length; i++)
		{
			  ABodyStandEnum standEnum = standEnums[i];
			String key = standEnum.toString();
			enumsMap.put(key + "-" + standEnum.getStatus() + "", standEnum.getName());
		}
		return enumsMap;
	}

	public String getStatusStr_Source()
	{
		if (this.status == 0)
		{
			this.statusStr = "禁用";
		} else if (this.status == 1)
		{
			this.statusStr = "启用";
		}
		return statusStr;
	}

	public String getSexStr()
	{
		ABodyStandEnum[] values = ABodyStandEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			  ABodyStandEnum standEnum = values[i];
			if (standEnum.toString().startsWith("SEX_"))
			{
				if (standEnum.getStatus() == this.sex)
				{
					this.sexStr = standEnum.getName();
				}
			}
		}

		return sexStr;
	}
	
	public String getStatusStr()
	{
		ABodyStandEnum[] values = ABodyStandEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			  ABodyStandEnum standEnum = values[i];
			if (standEnum.toString().startsWith("STATUS"))
			{
				if (standEnum.getStatus() == this.status)
				{
					this.statusStr = standEnum.getName();
				}
			}
		}

		return statusStr;
	}


	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getGrade()
	{
		return grade;
	}

	public void setGrade(int grade)
	{
		this.grade = grade;
	}

	public byte getSex()
	{
		return sex;
	}

	public void setSex(byte sex)
	{
		this.sex = sex;
	}

	public int getVitalcapacity()
	{
		return vitalcapacity;
	}

	public void setVitalcapacity(int vitalcapacity)
	{
		this.vitalcapacity = vitalcapacity;
	}

	public double getLongrun()
	{
		return longrun;
	}

	public void setLongrun(double longrun)
	{
		this.longrun = longrun;
	}

	public double getShortrun()
	{
		return shortrun;
	}

	public void setShortrun(double shortrun)
	{
		this.shortrun = shortrun;
	}

	public double getHeight()
	{
		return height;
	}

	public void setHeight(double height)
	{
		this.height = height;
	}

	public double getWeight()
	{
		return weight;
	}

	public void setWeight(double weight)
	{
		this.weight = weight;
	}

	public double getBml()
	{
		return bml;
	}

	public void setBml(double bml)
	{
		this.bml = bml;
	}

	public int getAbdominalcurl()
	{
		return abdominalcurl;
	}

	public void setAbdominalcurl(int abdominalcurl)
	{
		this.abdominalcurl = abdominalcurl;
	}

	public double getSittingforward()
	{
		return sittingforward;
	}

	public void setSittingforward(double sittingforward)
	{
		this.sittingforward = sittingforward;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

}
